package com.xmkj.jijidriver.order;

import android.content.Context;

import com.common.carbean.OderListXcBean;
import com.common.utils.EmptyUtils;
import com.common.widget.recyclerview.refresh.adapter.CommonAdapter;
import com.common.widget.recyclerview.refresh.adapter.ViewHolder;
import com.xmkj.jijidriver.R;

import java.util.List;

/**
 * Created by Administrator on 2017/12/19.
 */

public class OrderDetailsAdapter extends CommonAdapter<OderListXcBean.ListsEntity> {
    int type;

    public OrderDetailsAdapter(Context context, List<OderListXcBean.ListsEntity> data, int position) {
        super(context, data);
        this.type = position;
    }

    @Override
    protected void convert(ViewHolder holder, OderListXcBean.ListsEntity item, int position) {
        holder.setText(R.id.tv_name, item.nickname);
        holder.setText(R.id.tv_date, item.create_time);
        double money = 0.0;
        if (EmptyUtils.isNotEmpty(item.total)) {
            money = Double.valueOf(item.total);
        }

        holder.setText(R.id.tv_wash_money, "+" + money);
    }

    @Override
    protected int getItemViewLayoutId(int position, OderListXcBean.ListsEntity item) {
        return R.layout.item_order_detail;
    }
}
